package com.sgb.kjwl.view.ui.adapter.transport;


import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.transport.DriverBindRecordEntity;
import com.sgb.kjwl.utils.DefaultUtil;
import com.swgk.core.util.DateUtils;

import java.util.List;

/**
 * @author: 杨畔
 * @date: 2021/10/9 11:02
 * @Description: 司机绑定记录适配器
 */
public class DriverBindRecordAdapter extends BaseQuickAdapter<DriverBindRecordEntity, BaseViewHolder> {
    public DriverBindRecordAdapter(@Nullable List<DriverBindRecordEntity> data) {
        super(R.layout.app_item_driver_bind_record, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, DriverBindRecordEntity item) {
        helper.setText(R.id.tv_title, DefaultUtil.getString(item.getOperation()))
                .setText(R.id.tv_driver, DefaultUtil.getString(item.getRemark()))
                .setText(R.id.tv_user, DefaultUtil.getString(item.getOperationUser()))
                .setText(R.id.tv_date, DateUtils.stampToDay6(item.getCreateTime()));
    }
}
